<?php

class Main extends CI_Controller {

	function index()
	{	
		$data['cargar_modulo_administrador'] = $this->validate();
		$this->load->view('main', $data);
	}
	
	function load_module($module){
		switch ($module) {
			case 'admin':
				$this->load->view('management/administrador');
				break;
			case 'evaluate':
				$this->load->view('evaluation/evaluar');
				break;
			case 'statistics':
				$this->load->view('statistics/estadistica');
				break;
		}
	}
	
	private function validate(){
		$role_id = $this->session->userdata('role_id');
		$modulo_admin = "";
		if ($role_id==1){
			$modulo_admin = "<div class='section'>
                        <h3><a href='http://localhost/Sistema360/index.php/main/load_module/admin'>Administrador </a></h3>
                        <p><a href='http://localhost/Sistema360/index.php/main/load_module/admin'><img src='http://localhost/Sistema360/common/theme/img/Configuracion.jpg' width='191' height='150' alt='' /></a></p>    
                        <p align='justify' style='width: 187px;'>En este m&oacute;dulo, el administrador podr&aacute; configurar los diferentes componentes del sistema</p>
                        </div> <!-- /section -->";
		}
		
		return $modulo_admin;
	}
	
}
?>